<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "{{%set}}".
 *
 * @property int $id 主键
 * @property string $name 名称
 * @property string $val 值
 * @property int $type 类型 1是网站文本设置
 * @property int $sort 排序
 */
class Set extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%set}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'val'], 'required'],
            [['sort','type'], 'integer'],
            [['name','key'], 'string', 'max' => 50],
            [['val'], 'string', 'max' => 1000],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => '主键',
            'name' => '名称',
            'val' => '值',
            'type' => '类型 1是网站文本设置',
            'sort' => '排序',
        ];
    }
}
